﻿[%^Main%]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/DinoRichCMS.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- InstanceBeginEditable name="doctitle" -->
<title>VietSilver CMS</title>
<!-- InstanceEndEditable -->
<link href="~/../style/reset.css" rel="stylesheet" type="text/css" />
<link href="~/../style/960.css" rel="stylesheet" type="text/css" />
<link href="~/../style/global.css" rel="stylesheet" type="text/css" />
<link href="~/../style/jquery-ui-1.8.4.custom.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" language="javascript" src="~/../js/jquery-1.4.2.min.js"></script>
<script type="text/javascript" language="javascript" src="~/../js/jquery-ui-1.8.4.custom.min.js"></script>
<script type="text/javascript" language="javascript" src="~/../js/jquery.validate.pack.js"></script>
<script type="text/javascript" language="javascript" src="~/../js/global.js"></script>
<!-- InstanceBeginEditable name="head" -->
<script type="text/javascript" language="javascript">
	$().ready(function(){
		$("#accordion").accordion("activate", 2);
		$('input').removeAttr('checked');
		[%^FullControl%]
		ToggleSelect('viewFunction');
		ToggleSelect('editFunction');
		ToggleSelect('viewCategory');
		ToggleSelect('editCategory');[%$FullControl%][%^SelectItem%]
		SelectItem('viewFunction', '{{viewFunction}}');
		SelectItem('editFunction', '{{editFunction}}');
		SelectItem('viewCategory', '{{viewCategory}}');
		SelectItem('editCategory', '{{editCategory}}');[%$SelectItem%]
	});
	
	function ToggleSelect(className){
		if ($('.' + className + ':checked').size() == 0){
			$('.' + className).attr('checked', 'checked');
		}else{
			$('.' + className).removeAttr('checked');
		}
	}
	
	function SelectItem(className, IDs){
		if (IDs == '') return;
		
		var values = IDs.split(',');
			
		for(i = 0; i < values.length; i++){
			$('.' + className + '[value=' + values[i] + ']').attr('checked', 'checked');
		}
	}
	
	function SaveFunction(){
		var viewFunction = $('.viewFunction').serialize();
		var editFunction = $('.editFunction').serialize();
		var viewCategory = $('.viewCategory').serialize();
		var editCategory = $('.editCategory').serialize();
		
		AjaxResult('users&action=classify&id={{userID}}&' + viewFunction + '&' + editFunction + '&' + viewCategory + '&' + editCategory, '{{#SaveSettingOK}}', '{{#SaveSettingFail}}', false, function(data){ Redirect("user.aspx"); });
	}
</script>
<!-- InstanceEndEditable -->
<!--[if IE 5]>
<style type="text/css"> 
/* place css box model fixes for IE 5* in this conditional comment */
.twoColFixLtHdr #sidebar1 { width: 230px; }
</style>
<![endif]-->
<!--[if IE]>
<style type="text/css"> 
/* place css fixes for all versions of IE in this conditional comment */
.twoColFixLtHdr #sidebar1 { padding-top: 30px; }
.twoColFixLtHdr #mainContent { zoom: 1; }
/* the above proprietary zoom property gives IE the hasLayout it needs to avoid several bugs */
</style>
<![endif]-->
</head>
<body class="twoColFixLtHdr">
<div id="user">
	<div id="center_user">
	{{#Hi}} <strong>{{fullName}}</strong> | <a href="javascript:void(0);" onclick="javascript:LogOut();">{{#Logout}}</a>  
	<span id="company">{{#Company}}</span>
	</div>
</div>
<div id="logo">
	<div id="center_logo">
		<img id="vietsilver" src="~/../images/viet_silver.png" alt="viet silver" />
		<strong>{{#Language}}: </strong>[%^LanguageFlag%][%^LanguageFlagItem%]<a href="javascript:void(0);" class="language" onclick="javascript:ChangeLanguage('{{langCode}}');" title="{{langName}}"><img src="~/../images/{{langCode}}.png" alt="{{langName}}" /></a>[%$LanguageFlagItem%][%$LanguageFlag%]
	</div>
</div>
<div id="container">
  <div id="header">
  	<!--<a href="/">Home</a> Danh sách tin-->
	<div id="search">
		<form id="searchForm" action="news.aspx" method="post">
			<p>			  
			  <input type="text" id="search_" name="search" value="{{searchValue}}" style="text-align:left;" />
			  <input type="submit" value="" />
			</p>
		</form>
	</div>
  </div>
  <div id="sidebar1">
    <div id="accordion">
      <h3><a href="#"><img src="~/../images/news.png" /><em>{{#News}}</em></a></h3>
      <div>
        <ul>
          <li><a href="~/../news.aspx">{{#NewsList}}</a></li>
          <li><a href="~/../news.aspx?type=add">{{#AddNew}}</a></li>
          <li><a href="~/../category.aspx?filter=news">{{#ListCategory}}</a></li>
        </ul>
      </div>
      <h3><a href="#"><img src="~/../images/product.png" /><em>{{#Products}}</em></a></h3>
      <div>
        <ul>
          <li><a href="~/../product.aspx">{{#ProductList}}</a></li>
          <li><a href="~/../product.aspx?type=add">{{#AddNew}}</a></li>
          <li><a href="~/../category.aspx?filter=product">{{#ListCategory}}</a></li>
          <!--<li><a href="~/../order.aspx">{{#Orders}}</a></li>-->
        </ul>
      </div>
      <!--<h3><a href="#">{{#Categories}}</a></h3>
      <div>
        <ul>
          <li><a href="category.aspx">{{#ListCategory}}</a></li>
          <li><a href="category.aspx?type=add">{{#AddNew}}</a></li>
        </ul>
      </div>-->
      <h3><a href="#"><img src="~/../images/user.png" /><em>{{#Admin}}</em></a></h3>
      <div>
        <ul>
          <li><a href="~/../user.aspx">{{#UserList}}</a></li>
          <li><a href="~/../user.aspx?type=add">{{#AddNew}}</a></li>
        </ul>
      </div>
      <h3><a href="#"><img src="~/../images/advertise.png" /><em>{{#Advertise}}</em></a></h3>
      <div>
        <ul>
          <li><a href="~/../advertise.aspx">{{#AdvertiseList}}</a></li>
          <li><a href="~/../advertise.aspx?type=add">{{#AddNew}}</a></li>
          <li><a href="~/../layout.aspx?type=advertise-position">{{#ConfigPosition}}</a></li>
        </ul>
      </div>
      <h3><a href="#"><img src="~/../images/position.png" /><em>{{#Position}}</em></a></h3>
      <div>
        <ul>
          <li><a href="~/../position.aspx">{{#PositionList}}</a></li>
          <li><a href="~/../position.aspx?type=add">{{#AddNew}}</a></li>
        </ul>
      </div>
      <h3><a href="#"><img src="~/../images/setting.png" /><em>{{#Other}}</em></a></h3>
      <div>
        <ul>
          <li><a href="~/../layout.aspx?type=category-position&categoryType=news-category">{{#Layout}}</a></li>
          <li><a href="~/../setting.aspx">{{#Settings}}</a></li><li><a href="~/../roomgallery.aspx?type=edit&id=0">{{#Map}}</a></li><li><a href="~/../roomgallery.aspx?type=add">{{#NewMap}}</a></li>
        </ul>
      </div>
    </div>
  </div>
  <div id="mainContent">
  	<!-- InstanceBeginEditable name="Content" -->[%^Content%]
    <h3>&raquo; {{#Classify}} {{#User}}</h3>
    <div id="errorAjax" class="result">
      <p><img src="~/../images/ok.png" /><span id="result-message"></span></p>
    </div>
    [%^Table%]
    <form id="editForm" action="user.aspx" method="post">
      <p>
      <table class="mainTable">
        <thead>
          <tr>
            <th width="*">{{#Function}}</th>
            <th width="8%"><a href="javascript:void(0);" onclick="ToggleSelect('viewFunction');">{{#View}}</a></th>
            <th width="8%"><a href="javascript:void(0);" onclick="ToggleSelect('editFunction');">{{#Edit}}</a></th>
          </tr>
        </thead>
        [%^Paging%]
        <tfoot>
          <tr>
            <td colspan="4"><ul class="paging">
                <li class="info">{{#Page}} <strong>{{currentPage}}</strong> / {{totalPage}} ({{totalRecord}} {{#Record}})</li>
                [%^PagingItem%]
                <li><a href="user.aspx?page={{pageIndex}}{{searchInfo}}"{{currentPageStyle}}>{{pageIndex}}</a></li>
                [%$PagingItem%]
              </ul></td>
          </tr>
        </tfoot>
        [%$Paging%]
        <tbody>
          <tr>
            <td><label>{{#News}}</label></td>
            <td><input type="checkbox" name="viewFunction" class="viewFunction" value="news.aspx" /></td>
            <td><input type="checkbox" name="editFunction" class="editFunction" value="news.aspx" /></td>
          </tr>
          <tr>
            <td><label>{{#Categories}} {{#NewsLC}}</label></td>
            <td><input type="checkbox" name="viewFunction" class="viewFunction" value="category.aspx?filter=news" /></td>
            <td><input type="checkbox" name="editFunction" class="editFunction" value="category.aspx?filter=news" /></td>
          </tr>
          <tr>
            <td><label>{{#Products}}</label></td>
            <td><input type="checkbox" name="viewFunction" class="viewFunction" value="product.aspx" /></td>
            <td><input type="checkbox" name="editFunction" class="editFunction" value="product.aspx" /></td>
          </tr>
          <tr>
            <td><label>{{#Categories}} {{#ProductLC}}</label></td>
            <td><input type="checkbox" name="viewFunction" class="viewFunction" value="category.aspx?filter=product" /></td>
            <td><input type="checkbox" name="editFunction" class="editFunction" value="category.aspx?filter=product" /></td>
          </tr>
          <tr>
            <td><label>{{#Users}}</label></td>
            <td><input type="checkbox" name="viewFunction" class="viewFunction" value="user.aspx" /></td>
            <td><input type="checkbox" name="editFunction" class="editFunction" value="user.aspx" /></td>
          </tr>
          <tr>
            <td><label>{{#Advertise}}</label></td>
            <td><input type="checkbox" name="viewFunction" class="viewFunction" value="advertise.aspx" /></td>
            <td><input type="checkbox" name="editFunction" class="editFunction" value="advertise.aspx" /></td>
          </tr>
          <tr>
            <td><label>{{#Position}}</label></td>
            <td><input type="checkbox" name="viewFunction" class="viewFunction" value="position.aspx" /></td>
            <td><input type="checkbox" name="editFunction" class="editFunction" value="position.aspx" /></td>
          </tr>
          <tr>
            <td><label>{{#Layout}}</label></td>
            <td><input type="checkbox" name="viewFunction" class="viewFunction" value="layout.aspx" /></td>
            <td><input type="checkbox" name="editFunction" class="editFunction" value="layout.aspx" /></td>
          </tr>
          <tr>
            <td><label>{{#Settings}}</label></td>
            <td><input type="checkbox" name="viewFunction" class="viewFunction" value="setting.aspx" /></td>
            <td><input type="checkbox" name="editFunction" class="editFunction" value="setting.aspx" /></td>
          </tr>
        </tbody>
      </table>
      </p>
      <p>
      <table class="mainTable">
        <thead>
          <tr>
            <th width="*">{{#Categories}}</th>
            <th width="8%"><a href="javascript:void(0);" onclick="ToggleSelect('viewCategory');">{{#View}}</a></th>
            <th width="8%"><a href="javascript:void(0);" onclick="ToggleSelect('editCategory');">{{#Edit}}</a></th>
          </tr>
        </thead>
        [%^Paging%]
        <tfoot>
          <tr>
            <td colspan="4"><ul class="paging">
                <li class="info">{{#Page}} <strong>{{currentPage}}</strong> / {{totalPage}} ({{totalRecord}} {{#Record}})</li>
                [%^PagingItem%]
                <li><a href="user.aspx?page={{pageIndex}}{{searchInfo}}"{{currentPageStyle}}>{{pageIndex}}</a></li>
                [%$PagingItem%]
              </ul></td>
          </tr>
        </tfoot>
        [%$Paging%][%^CategoryList%]
        <tbody>
        [%^CategoryListItem%]
        <tr>
          <td><label{{position}}><a target="_blank" href="{{categoryURL}}">{{categoryName}}</a></label></td>
          <td><input type="checkbox" name="viewCategory" class="viewCategory" value="{{categoryID}}" /></td>
          <td><input type="checkbox" name="editCategory" class="editCategory" value="{{categoryID}}" /></td>
        </tr>
        [%$CategoryListItem%]
        </tbody>
        [%$CategoryList%]
      </table>
      </p>
      <p class="classifyAction"><a class="button action" href="javascript:void(0);" onclick="SaveFunction();">{{#Save}}</a></p>
    </form>
    [%$Table%][%^Error%]
    <div id="notFound" class="editError">{{#NotFound}}</div>
    <script>$('#notFound').show();</script>
    [%$Error%][%$Content%]<!-- InstanceEndEditable -->
  </div>
  <br class="clearfloat" />
  <div id="footer" class="clearfix">
  	<p class="fleft">{{#CopyrightText}}</p>
  </div>
</div>
</body>
<!--{{errorCode}}-->
<!-- InstanceEnd --></html>
[%$Main%]